import request from '@/utils/request'

export default {
  // 模糊查询带分页
  getList(department,noticeTitle,pageIndex,pageSize) {
    return request({
      url: `/notice/getList`,
      method: 'get',
      params: {department,noticeTitle,pageIndex,pageSize}
    })
  },

  // 新增通知
  save(notice) {
    return request({
      url: `/notice/saveNotice`,
      method: 'post',
      data: notice
    })
  },

  // 根据id删除通知列表

  delete(idArr) {
    return request({
      url: `/notice/deleteNoticeByIds`,
      method: 'delete',
      data: idArr
    })
  },
  // 根据id查通知列表
  getById(id) {
    return request({
      url: `/notice/getNoticeById/${id}`,
      method: 'get'
    })
  },


//根据id删除评论
deletest(id) {
  return request({
    url: `/oa_comments/delete/${id}`,
    method: 'delete',
  })
},
  // 修改通知
  update(notice) {
    return request({
      url: `/notice/UpdateNotice/${notice.noticeId}`,
      method: 'post',
      data: notice
    })
  },
  // /notice/publish
  // 发布
  publish(data){
    return request({
      url: `/notice/publish`,
      method: 'put',
      data
    })
  },
  // /notice/undoPublish
  // 取消发布
  undoPublish(data){
    return request({
      url: `/notice/undoPublish`,
      method: 'put',
      data
    })
  },
}
